package CollectIteratorDemo;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class cs {

    public static void main(String[] args) {
        int i = 5;
        int rs = ++i;
        System.out.println(i);//6
        System.out.println(rs);//5
        System.out.println("------------");
        List<String> list = new ArrayList<>();
        list.add("唐僧");
        list.add("孙悟空");
        list.add("白龙马");
        Iterator<String> it = list.iterator();
        while (it.hasNext()) {
            System.out.println(it.next());
        }

    }

}
